#include "nad_hplatte.h"
#include "../GlobalVars/vars.h"
#include "../TextureFunctions/texturefunctions.h"
#include <GL/gl.h>

// Camera parameters:
//	Look-from = (9.62463, 7.71847, 11.5746)
//	Look-at = (2, 2, 3.95)
//	Look-up = (0, 1, 0)
//	Clipping, near = 0.01, far = 1e+006
//	Field-of-view = 0.489957, image-aspect-ratio = 1.33333
//	Window size = (0.666667, 0.5), focal-distance = 10

// Current light source name = "defaultambient"
//	Light = Ambient
//	color = (1, 1, 1)
//	intensity = 1

// Polygons for object 'platte' (12 polygons)

	void
platte()
{
	static GLfloat VertexData[] = {
		2.15460f, 3.99464f, 5.95000f, 2.15460f, 3.99464f, 5.95000f, 2.15460f, 3.99464f, 5.95000f, 
		1.94527f, 0.000123978f, 5.95000f, 1.94527f, 0.000123978f, 5.95000f, 
		1.94527f, 0.000123978f, 5.95000f, 2.15460f, 3.99464f, 1.95000f, 
		2.15460f, 3.99464f, 1.95000f, 2.15460f, 3.99464f, 1.95000f, 
		1.94527f, 0.000123978f, 1.95000f, 1.94527f, 0.000123978f, 1.95000f, 
		1.94527f, 0.000123978f, 1.95000f, 2.05475f, 3.99988f, 1.95000f, 
		2.05475f, 3.99988f, 1.95000f, 2.05475f, 3.99988f, 1.95000f, 
		1.84540f, 0.00535774f, 1.95000f, 1.84540f, 0.00535774f, 1.95000f, 
		1.84540f, 0.00535774f, 1.95000f, 2.05475f, 3.99988f, 5.95000f, 
		2.05475f, 3.99988f, 5.95000f, 2.05475f, 3.99988f, 5.95000f, 
		1.84540f, 0.00535774f, 5.95000f, 1.84540f, 0.00535774f, 5.95000f, 
		1.84540f, 0.00535774f, 5.95000f
	};
	static GLfloat NormalData[] = {
		0.0523426f, 0.998629f, 0.000000f, 0.000000f, 0.000000f, 1.00000f, 0.998630f, -0.0523338f, 0.000000f, 
		-0.0523346f, -0.998630f, 0.000000f, 0.000000f, 0.000000f, 1.00000f, 
		0.998630f, -0.0523338f, 0.000000f, 0.0523426f, 0.998629f, 0.000000f, 
		0.000000f, 0.000000f, -1.00000f, 0.998630f, -0.0523338f, 0.000000f, 
		-0.0523346f, -0.998630f, 0.000000f, 0.000000f, 0.000000f, -1.00000f, 
		0.998630f, -0.0523338f, 0.000000f, 0.0523426f, 0.998629f, 0.000000f, 
		-0.998629f, 0.0523376f, 0.000000f, 0.000000f, 0.000000f, -1.00000f, 
		-0.0523346f, -0.998630f, 0.000000f, -0.998629f, 0.0523376f, 0.000000f, 
		0.000000f, 0.000000f, -1.00000f, 0.0523426f, 0.998629f, 0.000000f, 
		0.000000f, 0.000000f, 1.00000f, -0.998629f, 0.0523376f, 0.000000f, 
		-0.0523346f, -0.998630f, 0.000000f, 0.000000f, 0.000000f, 1.00000f, 
		-0.998629f, 0.0523376f, 0.000000f
	};
	static GLfloat TexCoordData[] = {
		0.000000f, 0.000000f, 1.00000f, 1.00000f, 0.000000f, 1.00000f, 
		0.000000f, 1.00000f, 1.00000f, 0.000000f, 
		0.000000f, 0.000000f, 1.00000f, 0.000000f, 
		0.000000f, 1.00000f, 1.00000f, 1.00000f, 
		1.00000f, 1.00000f, 0.000000f, 0.000000f, 
		1.00000f, 0.000000f, 1.00000f, 1.00000f, 
		0.000000f, 1.00000f, 1.00000f, 1.00000f, 
		1.00000f, 0.000000f, 0.000000f, 0.000000f, 
		1.00000f, 0.000000f, 0.000000f, 1.00000f, 
		0.000000f, 1.00000f, 1.00000f, 1.00000f, 
		0.000000f, 0.000000f, 0.000000f, 0.000000f, 
		1.00000f, 0.000000f
	};
	static GLint Indices[] = {
		2, 5, 8, 5, 11, 8, 7, 10, 14, 10, 17, 14, 13, 16, 20, 16, 
		23, 20, 19, 22, 1, 22, 4, 1, 18, 0, 12, 0, 6, 12, 3, 21, 
		9, 21, 15, 9
	};

	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
	glTexCoordPointer(2, GL_FLOAT, 0, TexCoordData);
	glEnableClientState(GL_NORMAL_ARRAY);
	glNormalPointer(GL_FLOAT, 0, NormalData);
	glEnableClientState(GL_VERTEX_ARRAY);
	glVertexPointer(3, GL_FLOAT, 0, VertexData);

			// Material attributes for surface '..\R063_D.jpg'
	OGL_Set_Current_Material_Parameters(32.0000f, 1.00000f, 1.00000f, 1.00000f, 0.000000f, 0.000000f, 0.000000f);

	// Set a new diffuse texture map
	OGL_Set_Current_Texture_Map(holz4, 1.00000f, 1.00000f, 0.000000f, 0.000000f);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[0]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[3]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[6]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[9]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[12]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[15]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[18]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[21]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[24]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[27]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[30]);
	glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &Indices[33]);
}	// End of polygons for object 'platte'
